<?
define('SITE_AREA', 'resources');
$jsFile = 'jsResources.js';
require_once('includes/appInit.php');
include('includes/ajax/sysData.php');
include('includes/ajax/ajaxResources.php');
require_once('includes/header.php');

$resourceGroupSelect = getCategories('Resource','select');
?>
	<div id="addEditFormDiv" style="display: none;"></div>	
	
<div id="content0" style="padding: 10px; width: 95%;" class="x-layout-inactive-content">
	<div id="controlBar">
		<div style="float: left;">
			<b>View resources for: </b>
			<select id="selectResourceGroupView" style="width: 250px;" onChange="resourcesGetObj.getResources(this[this.selectedIndex].value); return false;">
			<?=$resourceGroupSelect; ?>
			</select>
		</div>
		<div style="float: right;">
			<a href="#" class="coolButton buttonBGBlueGray" id="buttonAddEditResource" onClick="resourcesSupportObj.openAddEditFormResource('add'); return false;"><span class="add">New Resource</span></a>
		</div>
		<div style="clear: both;"></div>
	</div>	
	
	<div id="content1FormDiv">
		<div id="formAddEditResource" class="blueBox" style="display: none;">	
			<input type="hidden" id="formAction" value="add" />
			<input type="hidden" id="resourceID" />
			
			<p>
				<label class="vertLabelSmall">Resource Type</label>
				<select size="1" style="width: 200px;" id="rType">
				<option>Select...</option>
				<option></option>
				<?=$resourceGroupSelect; ?>
				</select>				
			</p>
			
			<p><label class="vertLabelSmall">Provider Name</label>
			<input type="text" style="width: 500px; margin-right: 5px;" id="rName" />
			</p>
			
			<p><label class="vertLabelSmall">Provider Description</label>
			<textarea style="width: 500px; height: 50px; margin-right: 5px;" id="rDescription"></textarea>
			</p>
			
			<p><label class="vertLabelSmall">Provider Website</label>
			<input type="text" style="width: 500px; margin-right: 5px;" id="rURL" />
			</p>
			
			<p><label class="vertLabelSmall">Provider Contact Person</label>
			<input type="text" style="width: 500px; margin-right: 5px;" id="rContactPerson" />
			</p>		
			
			<p><label class="vertLabelSmall">Provider Service Area</label>
			<input type="text" style="width: 500px; margin-right: 5px;" id="rServiceArea" />
			</p>
			
			<p><label class="vertLabelSmall">Provider Address</label>
			<input type="text" style="width: 500px; margin-right: 5px;" id="rAddress" />
			</p>
			
			<p><label class="vertLabelSmall">Provider City</label>
			<input type="text" style="width: 500px; margin-right: 5px;" id="rCity" />
			</p>
			
			<p>
				<div style="float: left; width: 200px; margin: 0 10px 0 5px;">
				<label class="vertLabelSmall">State</label>
				<select id="rState" style="width: 200px;">
				<? include('includes/states.html'); ?>
				</select>
				</div>
				<div style="float: left; width: 150px; margin-right: 10px;">
				<label class="vertLabelSmall">Zip Code</label>
				<input type="text" style="width: 150px; margin-right: 5px;" id="rZip" />
				</div>				
				<div style="clear: left;"></div>
			</p>
			
			<p>
				<div style="float: left; width: 150px; margin: 0 10px 0 5px;">
				<label class="vertLabelSmall">Phone</label>
				<input type="text" style="width: 150px; margin-right: 5px;" id="rPhone" />
				</div>
				<div style="float: left; width: 150px; margin-right: 10px;">
				<label class="vertLabelSmall">Fax</label>
				<input type="text" style="width: 150px; margin-right: 5px;" id="rFax" />
				</div>
				<div style="float: left; width: 180px;">
				<label class="vertLabelSmall">Email Address</label>
				<input type="text" style="width: 180px; margin-right: 5px;" id="rEmail" />
				</div>
				<div style="clear: left;"></div>
			</p>
			
			<p>
				<div style="float: left; width: 210px; margin: 0 10px 0 5px;">
				<label class="vertLabelSmall">Select Counties</label>
				<select id="rCounties" multiple onClick="resourcesSupportObj.copyCounties(this[this.selectedIndex].value);" style="width: 200px; height: 80px;">
				<? include('includes/countiesOregon.html'); ?>
				</select>
				</div>
				<div style="float: left; margin-top: 20px; width: 200px;" id="rCountyList">
				</div>				
				<div style="clear: left;"></div>
			</p>
			
			<p><label class="vertLabelSmall">Provider Notes</label>
			<textarea style="width: 500px; height: 50px; margin-right: 5px;" id="rNotes"></textarea>
			</p>
			
			<div style="float: left; margin-left: 5px; margin-right: 5px;">
				<a href="#" class="coolButton buttonBGBlueGray" onClick="resourcesUpdateObj.saveResource(); return false;"><span class="save">Save</span></a>
			</div>
			<div style="float: left;">
				<a href="#" class="coolButton buttonBGRed" onClick="resourcesSupportObj.closeAddEditFormResource(); return false;"><span class="cancel">Cancel</span></a>
			</div>
			<div style="float: left; margin-left: 10px;">
				<div id="messageSaveResource"></div>
			</div>
			<div style="clear: left;"></div>
		</div>
	</div>
	<div><h1 id="resourceViewTitle"></h1></div>
	<div id="resourceList"></div>
	
</div>
<div id="content1">
	<div id="buttonAdd" style="float: left; width: 180px;">
		<a href="#" class="coolButton buttonBGBlueGray" tabindex="30" onClick="resourcesSupportObj.openAddEditForm('add'); return false;"><span class="add">Add New File</span></a>
	</div>
	<div id="statusDiv" style="float: left;"></div>
	<div style="clear: left; height: 10px;"></div>
	
	<div id="content0FormDiv">
		<div id="formAddEdit" class="blueBox" style="display: none;">		
			<iframe id="fileFrame" name="fileFrame" frameborder="0" scrolling="yes" style="width: 100%; height: 400px;" class="uploadIFrame" src="uploadFile.php" ></iframe>
		</div>
		<div id="progressDiv" style="margin-top: 5px;"></div>
	</div>
	
	<div><h1></h1></div>
	<div id="resourceFileCategoryList"></div>	
</div>		
	<div id="south"></div>  
<? include("includes/footer.php"); ?>